﻿<?
defined( '_JEXEC' ) or die( 'Restricted access' );

?>

<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="5%">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->companies ); ?>);" />
			</th>
			<th width="5%">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="80%">
				Name
			</th>
			<th width="5%">Order<?php echo JHTML::_('grid.order',  $this->companies); ?></th>
			<th width="5%" nowrap="nowrap">Published</th>
		</tr>			
	</thead>
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->companies ); $i < $n; $i++)
	{		$row = &$this->companies[$i];
		$checked 	 = JHTML::_('grid.id',   $i, $row->id );
		$link 		 = JRoute::_( 'index.php?option=com_ecommerce&controller=companies&task=edit&cid[]='. $row->id );
		$link2		 = JRoute::_( 'index.php?option=com_ecommerce&controller=portfolios&filter='.$row->id );

		?>
		<tr class="<?php echo "row$k"; ?>">
			<td align="center">
				<?php echo $checked; ?>
			</td>
			<td align="center">
				<?php echo $this->page->getRowOffset( $i ); ?>
			</td>
			<td align="center">
				<a href="<?php echo $link; ?>"><?php echo $row->name; ?></a>
			</td>

			<td align="center">
					
					<?php $disabled = $ordering ?  '' : 'disabled="disabled"'; ?>
					<input type="text" name="order[]" size="5" value="<?php echo $row->ordering;?>" class="text_area" style="text-align: center" />
					
			</td>
		<?php if($row->published){ ?>
		<td width="5%" align="center" ><a href="#unpublishcat" onclick="return listItemTask('cb<?php echo $i;?>','unpublishcat')"><img border="0" alt="Published Cat" src="images/tick.png"/></a></td>
		<?php }else{ ?>
		<td width="5%" align="center" ><a href="#publishcat" onclick="return listItemTask('cb<?php echo $i;?>','publishcat')"><img border="0" alt="Unpublished Cat" src="images/publish_x.png"/></a></td>
		<?php } ?>
				
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
			<tr>
				<td colspan="7">
					<?php echo $this->page->getListFooter(); ?>
				</td>
			</tr>
	</table>
</div>

<input type="hidden" name="option" value="com_ecommerce" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="companies" />
</form>
